<template>
	<view class="kd-wallet-page">

		<view class="wallet-info-wrap">
			<image src="/static/image/big-wallet.png" class="wallet-icon"></image>

			<view class="balance-text">余额</view>

			<view class="balance-val">{{ money }}</view>


			<view class="detail-text" @click="handleToIncome">
				<view class="text">收益明细</view>
				<view class="icon-wrap">
					<uni-icons
						type="right"
						size="20"
						color="#999"
					></uni-icons>
				</view>
			</view>
		</view>

		<van-cell is-link :border="false" @click="handleToWithdrawal">
			<view slot="title" class="withdrawal-row">
				<image src="/static/image/withdrawal-icon.png"></image>
				<view class="withdrawal-text">提现</view>
			</view>
		</van-cell>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: ''
			};
		},
		methods: {
			handleToIncome() {
				uni.navigateTo({
					url: '/pages/rider/incomeList'
				})
			},
			handleToWithdrawal() {
				const {
					money
				} = this

				uni.navigateTo({
					url: '/pages/rider/withdrawal?money=' + money
				})
			}
		},
		onLoad(res) {
			const {
				money
			} = res

			this.money = money
		}
	}
</script>

<style lang="scss">
	.kd-wallet-page {
		padding-top: 20rpx;
		min-height: 100vh;
		background-color: #F2F2F2;


		.wallet-info-wrap {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding-top: 20rpx;
			margin-bottom: 20rpx;
			background-color: #fff;

			.wallet-icon {
				width: 128rpx;
				height: 128rpx;
			}

			.balance-text {
				font-size: 26rpx;
				margin: 20rpx 0;
				color: #999999;
			}

			.balance-val {
				font-size: 48rpx;
				margin-bottom: 42rpx;
			}

			.detail-text {
				display: flex;
				align-items: center;
				margin-bottom: 40rpx;

				.text {
					font-size: 24rpx;
					color: #999;
				}

				.icon-wrap {
					font-size: 0;
				}
			}
		}

		.withdrawal-row {
			display: flex;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-right: 6rpx;
			}

			.withdrawal-text {}
		}

	}
</style>